package com.inkFlow.book.domain.bo;

import com.inkFlow.book.domain.InkBook;
import com.inkFlow.common.core.validate.AddGroup;
import com.inkFlow.common.core.validate.EditGroup;
import com.inkFlow.common.mybatis.core.domain.BaseEntity;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 小说业务对象 ink_book
 *
 * @author inkFlow
 * @date 2025-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = InkBook.class, reverseConvertGenerate = false)
public class InkBookBo extends BaseEntity {

    /**
     * 小说id
     */
    private Integer bookId;

    /**
     * 爬虫标识
     */
    @NotNull(message = "爬虫标识不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer crawlSourceId;

    /**
     * 爬虫小说id
     */
    @NotBlank(message = "爬虫小说id不能为空", groups = { AddGroup.class, EditGroup.class })
    private String crawlBookId;

    /**
     * 作品方向，1：男频，2：女频
     */
    private Integer workDirection;

    /**
     * 小说名称
     */
    @NotBlank(message = "小说名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String bookName;

    /**
     * 小说简介
     */
    @NotBlank(message = "小说简介不能为空", groups = { AddGroup.class, EditGroup.class })
    private String bookDesc;

    /**
     * 作者表id
     */
    @NotNull(message = "作者表id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer authorId;

    /**
     * 作者名称
     */
    @NotBlank(message = "作者名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String authorName;

    /**
     * 小说封面
     */
    @NotBlank(message = "小说封面不能为空", groups = { AddGroup.class, EditGroup.class })
    private String coverUrl;

    /**
     * 点击量
     */
    @NotNull(message = "点击量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer visitCount;

    /**
     * 评论数
     */
    @NotNull(message = "评论数不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer commentCount;

    /**
     * 总字数
     */
    @NotNull(message = "总字数不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer wordCount;

    /**
     * 小说评分
     */
    @NotNull(message = "小说评分不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal bookScore;

    /**
     * 小说更新状态，1：连载中；2：完结
     */
    @NotNull(message = "小说更新状态，1：连载中；2：完结不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer updateStatus;

    /**
     * 书架状态，1：入库；2：上架
     */
    @NotNull(message = "书架状态，1：入库；2：上架不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer shelfStatus;

    /**
     * 审核状态，1：待审核；2：审核驳回；3：审核通过；4：删除待审核；5：已删除
     */
    @NotNull(message = "审核状态，1：待审核；2：审核驳回；3：审核通过；4：删除待审核；5：已删除不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer applyStatus;

    /**
     * 审核结果描述
     */
    @NotBlank(message = "审核结果描述不能为空", groups = { AddGroup.class, EditGroup.class })
    private String applyResult;

    /**
     * 最后一次的抓取时间
     */
    @NotNull(message = "最后一次的抓取时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date crawlLastTime;

    /**
     * 最新章节id
     */
    @NotNull(message = "最新章节id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer lastChapterId;

    /**
     * 小说来源，1：自有；2：爬虫
     */
    @NotNull(message = "小说来源，1：自有；2：爬虫不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer bookSource;

    /**
     * 是否收费，1：免费，2：收费
     */
    @NotNull(message = "是否收费，1：免费，2：收费不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer vipStatus;


}
